/*
 * @Author: 谢子健 1075010289@qq.com
 * @Date: 2024-09-21 21:55:24
 * @LastEditors: 谢子健 1075010289@qq.com
 * @LastEditTime: 2024-10-02 17:02:22
 * @FilePath: \ilink-vue-frontend\src\api\data\dataset.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// src/api/data/dataset.ts
import { api } from '@/api/api'; //
import type { Dataset } from '@/types/data/dataset';
/**
 * 获取公共数据集元数据
 * @param category 分类
 * @param keywords 关键词
 * @param sortBy 排序字段
 * @param page 当前页
 * @param pageSize 每页数量
 * @returns 返回数据集列表和总数
 */
export interface FetchDatasetsResponse {
  records: Dataset[];
  total: number;
  size: number;
}
export const getCategoryApi = async () => {
  try {
    const response = await api.get('/java/ground/dataset/get_common_dataset_tags');
    return response.data
  }
  catch (error) {
    console.error('获取资源信息失败', error)
    throw error
  }
}
export const getDatasetMetadataApi = async (payload: any) => {
  try {
    const response = await api.post('/java/ground/dataset/get_public_dataset_metadata', payload);
    return response.data;
  }
  catch (error) {
    console.error('获取数据集信息失败', error);
    throw error;
  }
};
